<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script type="text/javascript">
		// 所有的全局变量都可以通过window访问和定义
			var a = 15;
			// alert(window.a);
			window["b"] = 25;
			// alert(window.b);
			function jp(){
				console.log("你好")
			}
			// window["jp"]();
			// Date.now 获取1970 1月1月到现在的毫秒数
			var funname = "jp"+Date.now();
			console.log(funname);
			
			window[funname] = function(data){
				console.log(data);
				console.log("对面的妹子很漂亮")
			}
			// jp2();
			// window["jp2"]();
			var script =document.createElement("script");
			script.src="https://r.inews.qq.com/api/ip2city?otype=jsonp&callback="+funname;
			document.body.appendChild(script);
		</script>
		<!-- <script src="https://r.inews.qq.com/api/ip2city?otype=jsonp&callback=jp2"></script> -->
	</body>
</html>
